package com.aliwo.service.impl;

import com.aliwo.request.SaveSqlJobInfoRequest;
import com.aliwo.service.SqlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.powerjob.client.PowerJobClient;
import tech.powerjob.common.response.ResultDTO;

/**
 * @author:xuyayuan
 * @date:2021/7/26 14:06
 * @description:TODO
 */
@SuppressWarnings("all")
@Service
@Slf4j
@Transactional(readOnly = true, rollbackFor = Exception.class)
public class SqlServiceImpl implements SqlService {
    @Autowired
    private PowerJobClient powerJobClient;
    @Override
    public ResultDTO<Long> saveSqlJob(SaveSqlJobInfoRequest saveSqlJobInfoRequestrequest) {
        ResultDTO<Long> resultDTO = powerJobClient.saveJob(saveSqlJobInfoRequestrequest);
        return resultDTO;
    }
}
